package com.woniuxy.service.impl;

import com.woniuxy.dao.ManagerDao;
import com.woniuxy.entity.User;
import com.woniuxy.service.RbacManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName RbacManagerServiceImpl
 * @Description TODO
 * @Author LI.hh
 * @Date 2022/8/22 9:48
 * @Version 1.0
 */
@Service(value = "rms")
public class RbacManagerServiceImpl implements RbacManagerService{

    @Autowired
    private ManagerDao managerDao;

    public ManagerDao getManagerDao() {
        return managerDao;
    }

    public void setManagerDao(ManagerDao managerDao) {
        this.managerDao = managerDao;
    }

    @Override
    public List<User> selectAll() {
        return managerDao.selectAll();
    }

    @Override
    @Transactional
    public void addUser(User user) {
        managerDao.addUser(user);
        int i = 1/0;
    }

    @Override
    public void updateUser(User user) {
        managerDao.updateUser(user);
    }

    @Override
    public void deleteUserById(int id) {
        managerDao.deleteUserById(id);
    }
}
